<!--
 * @Author: folusGan 245942153@qq.com
 * @Date: 2024-07-08 10:25:57
 * @LastEditors: folusGan 245942153@qq.com
 * @LastEditTime: 2024-10-11 15:01:34
 * @Description: 
-->
<template>
  <el-dropdown trigger="click" @command="hanldeSetLanguage" class="mr-10">
    <div class="flex pointer">
      <div class="svg-wrap mr-10">
        <svg-icon icon-class="earth" class="header-svg"></svg-icon>
      </div>
      <div class="mr-10">{{ $t('language') }}</div>
      <div class="svg-wrap">
        <svg-icon icon-class="down" class="header-svg"></svg-icon>
      </div>
    </div>
    <el-dropdown-menu slot="dropdown">
      <el-dropdown-item command="zh-CN">中文</el-dropdown-item>
      <el-dropdown-item command="en">English</el-dropdown-item>
    </el-dropdown-menu>
  </el-dropdown>
</template>
<script>
export default {
  name: 'LangSelect',
  data() {
    return {}
  },
  methods: {
    hanldeSetLanguage(lang) {
      this.$i18n.locale = lang
      this.$store.dispatch('app/setLanguage', lang)
      // location.reload()
      // this.$message({
      //   message: lang + ':' + 'Switch Language Success',
      //   type: 'success',
      // })
    },
  },
}
</script>
<style lang="scss" scoped>
.flex {
  display: flex;
}
.el-dropdown {
  color: #e8ebf1;
}
.mr-10 {
  line-height: 60px;
}
</style>
